#include <iostream>
#include <vector>

using namespace std;

int main()
{
    int n = 0; cin >> n;
    vector<int> v(n,0);
    
    int sum = 0;
    for(int i = 0; i < n; i++)
    {
        cin >> v[i];
        sum += v[i];
    }
    
    if(sum % 2 == 1)
    {
        cout << "false";
    }
    else
    {
        vector<vector<int>> dp(510,vector<int>(510*100,false));
        dp[0][0] = true;
        sum /= 2;

        for(int i = 1; i <= n; i++)
        {
            for(int j = 0; j <= sum; j++)
            {
                dp[i][j] = dp[i-1][j];
                if(j >= v[i])
                {
                    dp[i][j] = dp[i-1][j-v[i]] || dp[i][j];
                }
            }
        }

        if(dp[n][sum])
            cout << "true";
        else
            cout << "false";
    }


    return 0;
}



#include <iostream>
#include <string>

using namespace std;

int main()
{
    string str; cin >> str;
    int ret = -1;
    
    for(int i = 0; i < str.size(); ++i)
    {
        if(i+1 < str.size() && str[i] == str[i+1])
        {
            ret = 2;
            break;
        }
        
        if(i+2 < str.size() && str[i] == str[i+2])
        {
            ret = 3;
        }
    }
    
    cout << ret;
    
    return 0;
}

#include <iostream>
#include <vector>
using namespace std;


int main()
{
    int n = 0; cin >> n;
    vector<int> arr(n+1,0);
    vector<int> f(n+1, 0);
    vector<int> g(n+1, 0);

    for(int i = 1; i <= n; ++i) cin >> arr[i];

    f[0] = 0;
    g[0] = 0;

    for(int i = 1; i <= n; ++i)
    {
        f[i] = g[i-1] + arr[i];
        g[i] = max(f[i-1], g[i-1]);
    }

    cout << max(f[n], g[n]);

    return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main()
{
    int n = 0, p = 0; cin >> n >> p;
    p *= 2;
    
    vector<int> nums(n, 0);
    
    for(int i = 0; i < n; ++i) cin >> nums[i];
    
    sort(nums.begin(), nums.end());
    
    int left = 0, right = 0, sum = 0, ret = 0;
    
    while(right < n)
    {
        while(nums[right] - nums[left] > p)
        {
            left++;
        }
        
        ret = max(ret, right-left+1);
        
        right++;
    }
    
    cout << ret;
    
    return 0;
}
